import axios from '../axios'

/*
 * 菜单管理模块
 */

 // 保存权限菜单
export const save = (data) => {
    return axios({
        url: '/authority/saveAuthority',
        method: 'post',
        data
    })
}
// 删除权限菜单
export const batchDelete = (params) => {
    return axios({
        url: '/authority/deleteAuthority',
        method: 'get',
        params
    })
}
// 编辑权限菜单
export const handleEdit = (data) => {
    return axios({
        url: '/authority/updateAuthority',
        method: 'POST',
        data
    })
}
// 查找导航菜单树
export const findNavTree = (params) => {
    return axios({
        url: 'authority/leftMenu',
        method: 'get',
        params
    })

}
// 查找导航菜单树
export const findMenuTree = (params) => {
    return axios({
        url: '/authority/queryList',
        method: 'get',
        params
    })
}
//查找平级树
export const findLevelTree = (params) => {
    return axios({
        url: 'authority/queryNotTreeList?authType=1',
        method: 'get',
        params
    })
}
//查找平级树
export const findLevenBtn = (params) => {
    return axios({
        url: 'authority/queryNotTreeList',
        method: 'get',
        params
    })
}
//菜单交换
export const changeMenu = (params) => {
    return axios({
        url: '/authority/changePosition',
        method: 'post',
        params
    })
}

// ################前台权限相关接口##############
//查询前台权限列表
export const findFontNavTree = (params) => {
    return axios({
        url: '/frontAuthority/leftMenu',
        method: 'get',
        params
    })

}
export const findFontNavTree2 = (params) => {
    return axios({
        url: '/frontAuthority/queryNotTreeList',
        method: 'get',
        params
    })

}
// 保存前台权限菜单
export const fontSave = (data) => {
    return axios({
        url: '/frontAuthority/saveAuthority',
        method: 'post',
        data
    })
}
// 编辑更新权限
export const  updateFontAuthority= (data) => {
    return axios({
        url: '/frontAuthority/updateAuthority',
        method: 'POST',
        data
    })
}
// 菜单交换
export const changeFontPosition = (params) => {
    return axios({
        url: '/frontAuthority/changePosition',
        method: 'post',
        params
    })
}
// 删除菜单
export const deleteFontAuthority = (params) => {
    return axios({
        url: '/frontAuthority/deleteAuthority',
        method: 'get',
        params
    })
}
